﻿using Domain.Entity;
using Repository.Base;
using System;
using Util;

namespace Repository
{
    public class WarnEnvironmentRepository : BaseRepository<WarnEnvironmentEntity>
    {
        private readonly SnowFlakeGenerator worker;
        public WarnEnvironmentRepository(SnowFlakeGenerator snowFlakeGenerator) : base(snowFlakeGenerator)
        {
            this.worker = snowFlakeGenerator;
        }

        public void Delete(DateTime endTime)
        {
            string sql = $" DELETE from warn_environment where `CreateTime`<='{endTime.ToString("yyyy-MM-dd HH:mm")}' ";
            this.GetDb().Ado.ExecuteCommand(sql);
        }
    }
}
